package com.rattkin.business
{
	import com.rattkin.model.vo.GameStatsVO;
	import com.rattkin.model.vo.KillratioStatsVO;
	import com.rattkin.model.vo.TotalGameStatsVO;
	
	import flash.events.Event;
	
	public class StatsManager extends BaseManager
	{
		private var _flags:Array;
		private var _players:Array;
		private var _games:Array;	   	   
		private var _lastKillratioStats:KillratioStatsVO;
		private var _totalKillratioStats:KillratioStatsVO;		
		private var _lastGameStats:GameStatsVO;
		private var _totalGameStats:TotalGameStatsVO;	   	   	 	   	   
		private var _cacheDate:Date;	   
		
		[Bindable(event="flagsChanged")]		
		public function get flags():Array {
			return _flags;
		}
		
		public function setFlags(flags:Array):void {
			this._flags = flags;
			dispatchEvent(new Event("flagsChanged"));
		}
		
		[Bindable(event="playersChanged")]		
		public function get players():Array {
			return _players;
		}       
		
		public function setPlayers(players:Array):void {
			this._players = players;
			dispatchEvent(new Event("playersChanged"));
		}    
		
		[Bindable(event="gamesChanged")]		
		public function get games():Array {
			return _games;
		}             
		
		public function setGames(games:Array):void {
			this._games = games;
			dispatchEvent(new Event("gamesChanged"));
		}  
				
		[Bindable(event="lastKillratioStatsChanged")]		
		public function get lastKillratioStats():KillratioStatsVO {
			return _lastKillratioStats;
		}   		
		        
		public function setLastKillratioStats(lastKillratioStats:KillratioStatsVO):void {
			this._lastKillratioStats = lastKillratioStats;
			dispatchEvent(new Event("lastKillratioStatsChanged"));
		}
		      
		[Bindable(event="totalKillratioStatsChanged")]		
		public function get totalKillratioStats():KillratioStatsVO {
			return _totalKillratioStats;
		}   				     		      
		        
		public function setTotalKillratioStats(totalKillratioStats:KillratioStatsVO):void {
			this._totalKillratioStats = totalKillratioStats;
			dispatchEvent(new Event("totalKillratioStatsChanged"));
		}		
		
		[Bindable(event="lastGameStatsChanged")]		
		public function get lastGameStats():GameStatsVO {
			return _lastGameStats;
		}   		
		
		public function setLastGameStats(lastGameStats:GameStatsVO):void {
			this._lastGameStats = lastGameStats;
			dispatchEvent(new Event("lastGameStatsChanged"));
		}
		        
		[Bindable(event="totalGameStatsChanged")]		
		public function get totalGameStats():TotalGameStatsVO {
			return _totalGameStats;
		}   				
		        
		public function setTotalGameStats(totalGameStats:TotalGameStatsVO):void {
			this._totalGameStats = totalGameStats;
			dispatchEvent(new Event("totalGameStatsChanged"));
		}
		  
		[Bindable(event="cacheDateChanged")]		
		public function get cacheDate():Date {
			return _cacheDate;
		}   
				  
		public function setCacheDate(cacheDate:Number):void {
			this._cacheDate = new Date(cacheDate * 1000);
			dispatchEvent(new Event("cacheDateChanged"));
		}         
				
	}
}